package com.exception;

import java.util.Scanner;

public class ExceptionClass2 {
	private static Scanner input;

	public static int add() throws Exception {
		input = new Scanner(System.in);
		try {
			System.out.println("Please input first number:");
			int a = input.nextInt();
			System.out.println("Please input second number:");
			int b = input.nextInt();
			return a + b;
		} catch (Exception ex) {
			throw ex;
//			 throw new Exception("Addition exception.");
		} finally {
			System.out.println("Finishing addition.");
		}
	}

	public static void main(String[] args) {
		try {
			System.out.println("Result is :" + add());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
